<table class="form-table-without-line">
    <tr class="client_title">
        <th>AppId</th>
        <td>
            <input type="text" id="appid" placeholder="AppId" class="am-form-field" required/>
        </td>
    </tr>
    <tr class="client_title">
        <th>秘钥</th>
        <td>
            <input type="text" id="secret" placeholder="请输入登录验证秘钥" class="am-form-field" required/>
            <button type="button" class="btn-save">保存</button>
        </td>
    </tr>
</table>

<style type="text/css">
    .form-table-without-line .logo-small, .form-table-without-line .logo-big {
        border: 1px solid #333;
    }
</style>

<script>
    $(".btn-save").click(function() {
        var data = {};
        data.key = "BOCAI_WECHAT";
        data.name = data.key;
        data.appId = $("#appid").val().trim();
        data.secret = $("#secret").val().trim();
        startLoading();
        CMD.weixin_save(data, function() {
            stopLoading();
        });
    });

    CMD.weixin_query(function(data) {
        if (!Util.isEmpty(data)) {
            $("#appid").val(data.appId || '');
            $("#secret").val(data.secret || '');
        }
    });
</script>
